<html>
<head>
  <title>AngularJS Ajax</title>
  <style>
  table, th , td {
    border: 1px solid grey;
    border-collapse: collapse;
    padding: 5px;
  }
   
  table tr:nth-child(odd) {
    background-color: #f2f2f2;
  }
  
  table tr:nth-child(even) {
    background-color: #ffffff;
  }
  </style>
</head>
<body>
  <h1>Sample Application</h1>
  <div ng-app="mainApp" ng-controller="studentController">
    <table>
      <tr>
        <th>Name</th>
        <th>Roll No</th>
        <th>Percentage</th>
      </tr>
      <tr ng-repeat="student in students">
        <td>{{ student.Name }}</td>
        <td>{{ student.RollNo }}</td>
        <td>{{ student.Percentage }}</td>
      </tr>
    </table>
  </div>
  <script src="js/angular.min.js"></script>
  <script>
  angular.module('mainApp', [])
  .controller('studentController', function($scope, $http){
  //function studentController($scope, $http){ // studentController not a function, got undefined
    var url = 'ajax/data.json';
    
    $http.get(url).success(function(response){
      $scope.students = response;
    });
  //}
  });
  </script>
</body>
</html>